import axios from 'axios'
import config from '../config'
import QS from 'qs'

const instance = axios.create({
  baseURL:config.baseURL,
  transformRequest:(data)=>{
    return QS.stringify(data);
  }
})


instance.interceptors.response.use((response)=>{
  return response.data;
},error => {
  return Promise.reject(error);
})


export default{
  get(url,params){
    return instance.get(url,{params})
  }
}

export default {
  post(url,params){
    return instance.post(url,params);
  }
}
